package com.car.service.impl;

import com.car.mapper.SysRoleMapper;
import com.car.pojo.Role;
import com.car.service.SysRoleMapperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysRoleMapperServiceImpl implements SysRoleMapperService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public List<Role> list(Role role, Integer pageSize, Integer pageNo) {
        Integer startIndex = (pageNo-1) * pageSize;
        return sysRoleMapper.list(role, startIndex, pageNo);

    }

    @Override
    public Integer selectSysUserCount(Role role) {
        return sysRoleMapper.selectSysUserCount(role);
    }

    @Override
    public Integer add(Role role) {
        return sysRoleMapper.add(role);
    }

    @Override
    public int delete(Integer role_id) {
        return sysRoleMapper.delete(role_id);
    }

    @Override
    public int update(Role role) {
        return sysRoleMapper.update(role);
    }

    @Override
    public Role getByid(Integer role_id) {
        return sysRoleMapper.getByid(role_id);
    }
}
